﻿using UnityEngine;
using System.Collections;

public class CameraController : MonoBehaviour {

    public GameObject mapController;

    public bool isCamareLoadFinish = false;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
    public void initCamera()
    {
        if (MapController.mapConfigure != null && mapController != null)
        {
            Mesh mesh = mapController.GetComponent<MapController>().backGroundMesh;

            Vector3 centerPoint = mesh.bounds.center;

            centerPoint.z = MapController.mapConfigure.CameraDistance;

            transform.position = centerPoint;

            transform.Rotate(new Vector3(180, 0, 0));
        }

        isCamareLoadFinish = true;
    }
}
